import os.path
os.path.isfile(fname)


class Myreadfile():
    N = 0
    A = []
    B = []

    def __init__(self, filepath):
        if not os.path.isfile(filepath):
            print("文件不存在")
        self.Datfile = open(filepath)
        self.file = Datfile.readlines()
        self.get_N()
        self.get_A()
        self.get_B()
        self.Datfile.close()

    def get_N(self):
        self.N = int(self.file[0])

    def get_A(self):
        for i in range(2, 2+self.N):
            temp = self.file[i][:-1].split(" ")
            self.A.append([int(j) for j in temp])

    def get_B(self):
        for i in range(2+self.N+1, 2+2*self.N):
            temp = self.file[i][:-1].split(" ")
            temp = [i for i in temp if i != ""]
            self.B.append([int(j) for j in temp])
